package com.yan.mapper;

import com.yan.pojo.User;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.support.SqlSessionDaoSupport;

import java.util.List;

public class UserMapperImpl extends SqlSessionDaoSupport implements UserMapper{


    @Override
    public List<User> selecuser() {
        User user=new User(5,"aaaa","aaaa");
        UserMapper mapper = getSqlSession().getMapper(UserMapper.class);
        mapper.adds(user);
        mapper.delect(5);
        return mapper.selecuser();
    }

    @Override
    public int adds(User user) {
        return getSqlSession().getMapper(UserMapper.class).adds(user);
    }

    @Override
    public int delect(int id) {
        return getSqlSession().getMapper(UserMapper.class).delect(id);
    }
}
